import { createRouter, createWebHistory } from 'vue-router'
import login from '../views/login/index.vue'
const routes = [
  {
    path:'/',
    redirect: '/login',  // 重定向:重新指向其它path,会改变网址
  },
  {
    path: '/login',
    name: 'login',
    component: login
  },
  {
    path: '/user',
    name: 'user',
    component: () => import('../views/user/index.vue')
  }
]
const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})
export default router
